package com.xhl.cloudnacosconfig.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xuhongliang
 * @date 2020/3/11
 */
@RestController
@RequestMapping("/config")
@RefreshScope
public class ConfigController {

    @Value("${user.age}")
    private String userAge;

    @Value("${user.name}")
    private String userName;

    @RequestMapping("/get")
    public String get() {
        return "user name :" + userName + "; age: " + userAge;
    }
}
